/**
 * @param {number} n
 * @param {number} start
 * @return {number}
*/
var xorOperation = function(n, start) {
  let result = 0;
  for(let i = 0; i < n; i++) {
    result = result ^ start + 2 * i;
  }
  return result;
};
let n = 5, start = 0;
console.log(xorOperation(n, start));
n = 4, start = 3;
console.log(xorOperation(n, start));
n = 1, start = 7;
console.log(xorOperation(n, start));
n = 10, start = 5;
console.log(xorOperation(n, start));

